﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL.BusinessRules;

namespace BLL
{
    public class HOADON: BusinessObject
    {
        public Guid MaHoaDon { get; set; }
        public string MaQuyenHoaDon { get; set; }
        public string SoHoaDon { get; set; }
        public string KyHieu { get; set; }
        public DateTime? NgayTaoHoaDon { get; set; }
        public string MaKhachHang { get; set; }
        public int? MaHinhThucThanhToan { get; set; }
        public int? MaLoaiTienTe { get; set; }
        public int? MaLoaiThue { get; set; }
        public string TenMatHangBan { get; set; }
        public string LyDoBanHang { get; set; }
        public string SoPhieuThu { get; set; }
        public decimal? GiamGia { get; set; }
        public decimal? ChietKhau { get; set; }
        public decimal? TienHangTruocThue { get; set; }
        public decimal? TienThue { get; set; }
        public decimal? TienHangSauThue { get; set; }
        public string TienBangChu { get; set; }
        public int? MaTinhTrangHoaDon { get; set; }
        public string NguoiMua { get; set; }
        public string NguoiBan { get; set; }
        public string ThuTruongDonVi { get; set; }
        public DateTime? NgayInHD { get; set; }
        public int? NguoiInHD { get; set; }
        public int? CreateBy { get; set; }
        public int? ModifiedBy { get; set; }
        public DateTime? ModifiedOn { get; set; }

        public List<DMTINHTRANGHOADON> lstTTHD = new List<DMTINHTRANGHOADON>();
        public List<DMQUYENHOADON> lstDMQHD = new List<DMQUYENHOADON>();
        public List<DMLOAITIENTE> lstDMLTT = new List<DMLOAITIENTE>();
        public List<DMHINHTHUCTHANHTOAN> lstDMHTTT = new List<DMHINHTHUCTHANHTOAN>();
        public List<DMLOAITHUE> lstDMLT = new List<DMLOAITHUE>();
        public List<DMKHACHHANG> lstDMKH = new List<DMKHACHHANG>();

        public HOADON()
        {
            AddRule(new ValidateRequired("SoHoaDon"));
            AddRule(new ValidateRequired("KyHieu"));
            AddRule(new ValidateRequired("NgayTaoHoaDon"));
            AddRule(new ValidateRequired("MaKhachHang"));
        }

        public HOADON(string maQuyenHoaDon, string soHoaDon, string kyHieu, DateTime? ngayTaoHoaDon, string maKhachHang, int? maHinhThucThanhToan, int? maLoaiTienTe, int? maLoaiThue,
                string tenMatHangBan, string lyDoBanHang, string soPhieuThu, decimal? giamGia, decimal? chietKhau, decimal? tienHangTruocThue,
                decimal? tienThue, decimal? tienHangSauThue, string tienBangChu, int? maTinhTrangHoaDon, string nguoiMua, string nguoiBan, string thuTruongDonVi,
                DateTime? ngayInHD, int? nguoiInHD, int? createBy, int? modifiedBy, DateTime? modifiedOn)
            :this()
        {
            MaQuyenHoaDon = maQuyenHoaDon;
            SoHoaDon = soHoaDon;
            KyHieu = kyHieu;
            NgayTaoHoaDon = ngayTaoHoaDon;
            MaKhachHang = maKhachHang;
            MaHinhThucThanhToan = maHinhThucThanhToan;
            MaLoaiTienTe = maLoaiTienTe;
            MaLoaiThue = maLoaiThue;
            TenMatHangBan = tenMatHangBan;
            LyDoBanHang = lyDoBanHang;
            SoPhieuThu = soPhieuThu;
            GiamGia = giamGia;
            ChietKhau = chietKhau;
            TienHangTruocThue = tienHangTruocThue;
            TienThue = tienThue;
            TienHangSauThue = tienHangSauThue;
            TienBangChu = tienBangChu;
            MaTinhTrangHoaDon = maTinhTrangHoaDon;
            NguoiMua = nguoiMua;
            NguoiBan = nguoiBan;
            ThuTruongDonVi = thuTruongDonVi;
            NgayInHD = ngayInHD;
            NguoiInHD = nguoiInHD;
            CreateBy = createBy;
            ModifiedBy = modifiedBy;
            ModifiedOn = modifiedOn;
        }
    }
}
